
<div class="box box-primary">
	<div class="box-body" >
	<div class="box-body" style="width: 100%">
		<div class="row">
			
			<div class="col-xs-3">
				<div class="input-group">
                 <span class="input-group-addon" id="sizing-addon1">原始文件名</span>
					<input type="text" class="form-control" id="originalFileName" name="originalFileName"  aria-describedby="sizing-addon1">
				</div>
			</div>
			
			<div class="col-xs-3">
				<div class="input-group">
                 <span class="input-group-addon" id="sizing-addon1">文件后缀</span>
					<input type="text" class="form-control" id="fileSuffix" name="fileSuffix"  aria-describedby="sizing-addon1">
				</div>
			</div>

			<div class="col-xs-1" style="width: 100px;">
				<button type="button" class="btn btn-block btn-default"
					onclick="condictionsSearch()">
					<i class="fa fa-search"></i> 搜索
				</button>
			</div>

			<div class="col-xs-1" style="width: 100px;">
				<button type="button" class="btn btn-block btn-primary"
					onclick="emptyCondition()">
					<i class="fa fa-trash"></i> 清空
				</button>
			</div>
			
			<!-- 
			<div class="col-xs-1" style="width: 100px;">
				<button type="button" class="btn btn-success" onclick="add()">
					<i class="fa fa-plus-circle fz"></i> 新增
				</button>
			</div>
			
			 -->
			
		</div>
		</div>
		<div id="theexampleArea">
			<table width="100%" class="table table-bordered table-striped"
				id="data_table"></table>
		</div>
	</div>
</div>

<script
	src="${request.contextPath}/lib/plugins/datatables/jquery.dataTables.min.js"></script>
<script type="text/javascript"
	src="${request.contextPath}/js/Form_data_Submit.js"></script>

<script>
	var timer = null;

	var table = $('#data_table')
			.DataTable(
					{
						ajax : {
							"url" : contextPath + "/soa/files/datas/search",
							"type" : "post",
							"dataType" : "json",
							"data" : function(d) {

							}
						},
						sPaginationType : "full_numbers",
						ordering : false,
						info : false,
						scrollX : false,
						scrollY : '50vh',
						processing : false,
						serverSide : true,
						paging : true,
						pageLength : 10,
						pagingType : "full_numbers",//number simple simple_numbers full 默认full_numbers
						lengthChange : false, //可变分页组件,下行可规定显示页数，左边是定义，右边是页面显示的效果（如-1就是搜全部，但页面显示的选项是ALL）
						//"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
						//dom : 'T<"clear">lfrtip',
						//tableTools : {
						//	"sSwfPath" : "/swf/copy_csv_xls_pdf.swf"
						//},
						searching : false,
						language : {
							sProcessing : "正在加载中......",
							sLengthMenu : "每页显示 _MENU_ 条记录",
							sInfo : "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
							sZeroRecords : "对不起，查询不到相关数据！",
							sEmptyTable : "表中无数据存在！",
							search : "查询:",
							paginate : {
								previous : "上一页",
								next : "下一页",
								first : "第一页",
								last : "最后一页"
							}
						},
						columns : [

								{
									title : '文件类型',
									width : "14%",
									data : 'fileTypeName',
									align : 'center',
									valign : 'middle'

								},
								{
									title : '原始文件名',
									width : "20%",
									data : 'originalFileName',
									align : 'center',
									valign : 'middle'
								},
								{
									title : '最终文件名',
									width : "20%",
									data : 'finalFileCode',
									align : 'center',
									valign : 'middle'
								},
								{
									title : '上传后的文件',
									width : "20%",
									data : 'fileName',
									align : 'center',
									valign : 'middle'
								},
								{
									title : '文件后缀',
									width : "10%",
									data : 'fileSuffix',
									align : 'center',
									valign : 'middle'
								},
								{
									title : '文件大小',
									width : "20%",
									data : 'fileSize',
									align : 'center',
									valign : 'middle'
								}
							//	,{
							//		title : '功能',
							//		width : "10%",
							//		data : function(e) {//这里给最后一列返回一个操作列表
										//var a = e.roleSence;
							//			return '<a class="btn btn-default btn-xs show-detail-json" data-whatever='
							//				+ e.id
							//					+ ' onclick="edit('
							//					+ e.id
							//					+ ')"><i class="icon-edit"></i>修改</a>';
							//		}
							//	}								
								]
					});

	//删除配件
	function del(id) {
		var d = dialog({
			title : '提示',
			content : '确认删除id为：' + id + ' 的这条记录？',
			okValue : '确认',
			ok : function() {
				$.ajax({
					async : false,
					url : contextPath + "/soa/parts/datas/del",
					data : {
						id : id
					},
					type : "post",
					dataType : "json",
					success : function(result) {
						if (result.status == 0) {
							var d = dialog({
								content : result.msg
							});
							d.show();
							setTimeout(function() {
								table.ajax.reload(null, false);
								d.close().remove();
							}, 2000);
						} else {
							var d = dialog({
								content : result.msg
							});
							d.show();
							setTimeout(function() {
								d.close().remove();
							}, 4000);
						}
					},
				});
			},
			cancelValue : '取消',
			cancel : function() {
			}

		});
		d.showModal();
	}

	//清空查询条件
	function emptyCondition() {
		$("#fileSuffix").val("");
		condictionsSearch();
	}
	//条件查询配件数据
	function condictionsSearch() {

		var originalFileName = $("#originalFileName").val();
		var fileSuffix = $("#fileSuffix").val();
		var url = contextPath + "/soa/files/datas/search";
		var data = {};
		data.originalFileName = originalFileName;
		data.fileSuffix = fileSuffix;
		table.settings()[0].ajax.url = url;
		table.settings()[0].ajax.data = {
			"params" : data
		};
		table.ajax.reload();
	}
</script>

<!-- <script type="text/javascript">   
    j = 1;  
    $(document).ready(function(){  
        $("#btn_add").click(function(){  
            document.getElementById("newUpload").innerHTML+='<div id="div_'+j+'"><input  name="file_'+j+'" type="file"  /><input type="button" value="删除"  onclick="del('+j+')"/></div>';  
              j = j + 1;  
        });  
    });  
      
    function del(o){  
         document.getElementById("newUpload").removeChild(document.getElementById("div_"+o));  
    }  
  
</script>   
    <form name="userForm" action="${request.contextPath}/soa/files/upload" enctype="multipart/form-data" method="post">  
        <div id="newUpload">  
            <input type="file" name="file">  
        </div>  
        <input type="button" id="btn_add" value="增加一行" >  
        <input type="submit" value="上传" >  
    </form>    -->





<style>
#example_wrapper {
	margin-top: 30px;
}

#example_wrapper .btn-group .btn {
	margin-right: 15px;
	border-radius: 3px;
	color: #fff
}

.wb-col {
	float: left;
	width: 60%;
}

.n-tect {
	float: left;
	line-height: 34px;
}

/* dataTables列内容居中 */
.table>tbody>tr>td {
	text-align: center;
}

/* dataTables表头居中 */
.table>thead:first-child>tr:first-child>th {
	text-align: center;
}

table.dataTable thead>tr>th {
	padding-right: 0px;
}

.sdown {
	position: absolute;
	right: 10px;
	top: 6px;
}

.pre {
	position: relative;
}
</style>
